import BScroll from "better-scroll"; //引入better-scroll

//设置横向滚动的方法

/*
@param {代表vue实例} that
@param {横}
*/

function betterScrollHorizontal(that, wrapper, content, num, itemWidth) {

    content.style.width = num * itemWidth + "rem";
    that.$nextTick(() => {
        that.scroll = new BScroll(wrapper, {
            scrollY: false, //关闭纵向滚动
            scrollX: true, //横向滚动
            startX: 0, //横向滚动开始位置
            click: true,//允许click事件
        });
    });
}

export { betterScrollHorizontal };
